package projet_v1.items.weapons;

import java.util.HashMap;

import projet_v1.Breed;
import projet_v1.Character;
import projet_v1.simulation.Simulator;
/**
 * This class manages the wooden stake.
 * 
 * @author Alexis Laurent
 *
 */
public class WoodenStake extends Weapon {
	
	private static final int DAMAGE_AGAINST_ZOMBIES = 0;
	private static final int DAMAGE_AGAINST_MADZOMBIES = 0;
	private static final int DAMAGE_AGAINST_VAMPIRES = 150;
	
	private static final double ACCURANCY = 1;
	
	/**
	 * Construtor of the wooden stake
	 */
	public WoodenStake(){
		// create the shotgun
		super(CategoryWeapon.WOODENSTAKE, ACCURANCY);
		// then add the damages
		HashMap<Breed,Integer> h = new HashMap<Breed, Integer>();
		h.put(Breed.ZOMBIE, DAMAGE_AGAINST_ZOMBIES);
		h.put(Breed.MADZOMBIE, DAMAGE_AGAINST_MADZOMBIES);
		h.put(Breed.VAMPIRE, DAMAGE_AGAINST_VAMPIRES);
		this.setDamages(h);		
	}

	public int hit(Character c) {
		int newDamages = ((damages.get(c.getBreed())));
		if(Simulator.GenerateRandomBoolean())
			newDamages = (int) (newDamages * accurancy);
		return newDamages;
	}

}